package uns.fit.gis.mapobj;

public class RealPoint {
	private double x;
	private double y;
	
	public RealPoint(double x, double y)
	{
		this.x = x;
		this.y = y;
	}
	
	public boolean equals(Object obj) {
		if(this == obj)
			return true;
		if((obj == null) || (obj.getClass() != this.getClass()))
			return false;
			
		RealPoint point = (RealPoint)obj;
		return ((x - point.x) < 0.000005) && ((y - point.y) < 0.000005);
	}
	
	public int hashCode() {
		String strX = String.valueOf(x);
		String strY = String.valueOf(y);
		return (strX + strY).hashCode();
	}

	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}
}
